package singleton

import (
	"fmt"
)

type Singleton interface {
	PrintSome()
}

type singleone struct {
	v int
}

var g_singleone *singleone

func GetInstance(v int) Singleton {
	if g_singleone == nil {
		g_singleone = &singleone{v}
	}
	return g_singleone
}

func (s *singleone) PrintSome() {
	fmt.Println("singleton value is", s.v)
}
